package com.k;

import java.io.File;

/**
 * spliter 分割符
 * separator 分隔符
 * delimiter 定界符
 * Windows Linux diff
 * @author k
 */
public class WindowsLinux {

    /**
     * Windows下，println() 等价于 print("\r\n")
     * Linux下，println()等价于print("\n")
     * Mac下，println()等价于print("\r")
     */
    void println(){
        System.out.println();
    }

    /**
     * Windows : CRLF ()回车加换行
     * Linux : LF(Line Feed) 换行
     * Mac : CR(Carriage Return) 回车
     */
    void crlf(){

    }

    /**
     * 换行符
     * system default line separator
     * @return separator
     */
    String lineSeparator(){
        System.getProperty("line.separator");
        return System.lineSeparator();
    }

    /**
     * 目录分隔符
     * system directory separator
     * @return separator
     */
    String dirSeparator(){
        return File.separator;
    }

    public static void main(String[] args) {
        String a = System.getProperty("line.separator");
        String b = System.lineSeparator();
        System.out.println(a);
        System.out.println(b);
        System.out.println(a==b);
    }

}
